/*
 * =====================================================================================
 *
 *       Filename:  dictmatch.h
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  2015/05/28 10时10分52秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Liu Yi (), swliuyi@gmail.com
 *   Organization:  
 *
 * =====================================================================================
 */
#ifndef DICT_MATCH
#define DICT_MATCH
#include <iostream>
#include <string>
#include <cstring>
#include <cstdlib>
#include  <map>
#include  <set>
#include  <fstream>

using namespace std;

class Dict
{
    private:
        set<string> _name;
    public:
        Dict() { }
        void LoadDict(string path)
        {
            ifstream file(path.c_str());
            string line;
            while( getline(file, line ))
            {
                _name.insert(line);
            }
        }
        bool Find(const string & str)
        {
            return _name.count(str);
        }
        set<string> & GetDict(){return _name;}
};
#endif
